/* 
 * File:   OperationBinaire.cpp
 * Author: Gab'z
 * 
 * Created on 2 mai 2012, 17:18
 */
/*
 * CLEAR supprime tous les éléments de la pile
 * DUP duplique le premier élément de la pile
 * DROP supprime le premier élément de la pile
 */
#include "OperateurAArg.h"

OperateurAArg::~OperateurAArg() {
}

void OperateurAArg::exec(Pile* pile) const throw (OperatorException) {
    Constante* c = 0;
    try {
        c = apply();
    } catch (OperatorException e) {
        throw OperatorException(e.what());
    }
    if (c != 0) {
        pile->push(c);
        delete c;
    }
}
